package com.supermarket.service.lmpl;

import com.supermarket.dao.Providersdao;

import com.supermarket.entity.Provider;
import com.supermarket.service.ProviderService;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class ProviderServiceImpl implements ProviderService {
    static SqlSession getsqlsession;
    static {
        getsqlsession=UserserviceImpl.getsqlsession;
    }
    public int count(String name, String parseInt) {
        int count = getsqlsession.getMapper ( Providersdao.class ).count ( name, parseInt );
        return count;


    }

    public List<com.supermarket.entity.Provider> dd
            (int pageIndex, int pagesize, String name, String parseInt) {
        List<Provider> dd = getsqlsession.getMapper
                ( Providersdao.class ).dd ( (pageIndex - 1) * pagesize, pagesize, name, parseInt );
        return dd;
    }

    public Provider selectid(Integer valueOf) {
        Provider id = getsqlsession.getMapper ( Providersdao.class ).selectdaoById ( valueOf );
        return id;
    }

    public int update(Provider der) {
        int updatedao = getsqlsession.getMapper ( Providersdao.class ).updatedao ( der );
        return updatedao;
    }

    public int add(Provider der) {
        int daoadd = getsqlsession.getMapper ( Providersdao.class ).daoadd ( der );
        return daoadd;
    }

    public int servicedel(Integer service) {

        int daodel = getsqlsession.getMapper ( Providersdao.class ).daodel ( service );
        return daodel;
    }
}
